import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      // 重定向
      path: '/',
      redirect: '/home'
    },
    {
      // 主页
      path: '/home',
      component: () => import('../views/home/home.vue'),
      children: [
        {
          // 重定向
          path: '/',
          redirect: '/find'
        },
        {
          // 企业
          path: '/company',
          component: () => import('../views/home/company/company.vue')
        },
        {
          // 答题
          path: '/question',
          component: () => import('../views/home/question/question.vue')
        },
        {
          // 发现
          path: '/find',
          component: () => import('../views/home/find/find.vue')
        },
        {
          // 我的
          path: '/my',
          component: () => import('../views/home/my/my.vue')
        }
      ]
    },
    {
      // 登录
      path: '/login',
      component: () => import('../views/login/login.vue')
    },
    {
      // 答题模块
      path: '/interview',
      component: () => import('../views/interview/interview.vue')
    },
    {
      // 系统信息模块
      path: '/message',
      component: () => import('../views/message/message.vue')
    },
    {
      // 职业模块
      path: '/companyPosition',
      component: () => import('../views/companyPosition/companyPosition.vue')
    },
    {
      // 企业详情
      path: '/companyDetail',
      component: () => import('../views/companyDetail/companyDetail.vue')
    },
    {
      // 面试技巧页面
      path: '/technicList',
      component: () => import('../views/technicList/technicList.vue')
    },
    {
      // 数据页面
      path: '/chart',
      component: () => import('../views/chart/chart.vue')
    },
    {
      // 面经页面
      path: '/shareList',
      component: () => import('../views/shareList/shareList.vue')
    },
    {
      // 搜索页面
      path: '/search/:key',
      component: () => import('../views/search/search.vue')
    }
  ]
})
